package de.mhu.mandalaui.attributes;

import java.io.PrintWriter;

import de.mhu.mandalaui.bind.DataRow;

public class NamedArrayAttribute extends ArrayAttribute {

	private Attribute parent;
	
	public NamedArrayAttribute(Attribute parent, String id) {
		setParent(parent);
		setId(id);
	}
	
	public NamedArrayAttribute(String id) {
		setId(id);
	}
	
	public boolean needFunctionImplementation() {
		return false;
	}

	public Attribute getParent() {
		return parent;
	}

	public void setParent(Attribute parent) {
		this.parent = parent;
	}

	@Override
	public void renderFunctionImplementation(PrintWriter out) {
	}

	public void renderRemoveAll(PrintWriter out) {
	}

	public void renderAppendData(PrintWriter out,DataRow row) {
	}
	
	public void renderAttributeName(PrintWriter out) {
		if (parent != null) {
			parent.renderAttributeName(out);
			//out.print('.');
		}
		out.append(getId());
	}


}
